package com.yiqingjing.utils;

import android.content.Context;
import android.content.Intent;
import android.location.LocationManager;
import android.provider.Settings;

public class ChangeGPS {
	private Context context;
	
	public ChangeGPS(Context context){
		this.context = context;
	}
	
	public String getGPSState(){
		boolean flag = Settings.Secure.isLocationProviderEnabled(context.getContentResolver(),
				LocationManager.GPS_PROVIDER);
		if(flag){
			return "开";
		}else{
			return "关";
		}
	}
	
	public Intent setGPSState(){
		Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
		return intent;
	}
}
